package com.shun.base;

import com.shun.common.utils.ShunEnvUtil;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

@Slf4j
@SpringBootApplication(scanBasePackages = "com.shun")
@MapperScan(basePackages = {"com.shun.base.mapper"})
public class ShunBaseApp {

    public static void main(String[] args) {
        log.info("启动ShunBase微服务...");
        SpringApplication application = new SpringApplication(ShunBaseApp.class);
        application.setBannerMode(Banner.Mode.OFF);
        ApplicationContext context = application.run(args);
        Environment env = context.getEnvironment();
        log.info("启动微服务成功，微服务名称：{},启动端口:{}", ShunEnvUtil.getApplicationName(env),ShunEnvUtil.getServerPort(env));

    }
}
